var userInfo=JSON.parse(sessionStorage.getItem("userInfo"));
Vue.component('selfmediaSlide',{
    props:["list","number"],
    template: '<div class="swiper-container">\n' +
    '                <div class="swiper-wrapper">\n' +
    '                    <div class="swiper-slide" v-for="(item,index) in list" @click="getNext(item.id)">\n' +
    '                        <p class="heatSlide" v-if="item.categoryName">{{item.categoryName}}</p>\n' +
    '                        <!--<span v-if="index==0" class="selfMedia-top1"></span>-->\n' +
    '                        <!--<span v-if="index==1" class="selfMedia-top2"></span>-->\n' +
    '                        <!--<span v-if="index==2" class="selfMedia-top3"></span>-->\n' +
    '                        <span :class="{\'0\':\'selfMedia-top1\',\'1\':\'selfMedia-top2\',\'2\':\'selfMedia-top3\'}[\'\'+index]"></span>\n' +
    '                        <div :style="bgimg(item.coverImgSrc)" class="swiper-lazy"></div>\n' +
    // '                        <img :src="item.coverImgSrc" class="swiper-lazy">\n' +
    '                        <div class="heatSlide-head"><span :style="bgimg(item.headImg)"></span>{{item.uName}}</div>' +
    '                        <div class="heatSlide-shadow"></div>\n' +
    '                        <div class="heatSlide-info">\n' +
    '                            <p><span class="selfMedia-hetz">{{item.praiseCount}}</span></p>\n' +
    // '                            <h6>{{item.title}}</h6>\n' +
    '                        </div>\n' +
    '                    </div>\n' +
    '                </div>\n' +
    '            </div>',
    data: function () {
        return {}
    },
    methods:{
        bgimg:function(url){
            url = url?url:"";
            return {
                "background-image":'url("'+url+'"),url("")'
            }
        },
        //跳转页面
        getNext:function(id,uid){
            location.href="/see/selfMediaVd?id="+id+"&uid="+userInfo.id+"&sourceType=1";
        }
    }
});